package com.ruoyi.manage.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.manage.mapper.ReserveMainMapper;
import com.ruoyi.manage.domain.ReserveMain;
import com.ruoyi.manage.service.IReserveMainService;

/**
 * 预订信息Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-05-08
 */
@Service
public class ReserveMainServiceImpl implements IReserveMainService 
{
    @Autowired
    private ReserveMainMapper reserveMainMapper;

    /**
     * 查询预订信息
     * 
     * @param reserveId 预订信息主键
     * @return 预订信息
     */
    @Override
    public ReserveMain selectReserveMainByReserveId(Long reserveId)
    {
        return reserveMainMapper.selectReserveMainByReserveId(reserveId);
    }

    /**
     * 查询预订信息列表
     * 
     * @param reserveMain 预订信息
     * @return 预订信息
     */
    @Override
    public List<ReserveMain> selectReserveMainList(ReserveMain reserveMain)
    {
        return reserveMainMapper.selectReserveMainList(reserveMain);
    }

    /**
     * 新增预订信息
     * 
     * @param reserveMain 预订信息
     * @return 结果
     */
    @Override
    public int insertReserveMain(ReserveMain reserveMain)
    {
        reserveMain.setCreateTime(DateUtils.getNowDate());
        return reserveMainMapper.insertReserveMain(reserveMain);
    }

    /**
     * 修改预订信息
     * 
     * @param reserveMain 预订信息
     * @return 结果
     */
    @Override
    public int updateReserveMain(ReserveMain reserveMain)
    {
        reserveMain.setUpdateTime(DateUtils.getNowDate());
        return reserveMainMapper.updateReserveMain(reserveMain);
    }

    /**
     * 批量删除预订信息
     * 
     * @param reserveIds 需要删除的预订信息主键
     * @return 结果
     */
    @Override
    public int deleteReserveMainByReserveIds(Long[] reserveIds)
    {
        return reserveMainMapper.deleteReserveMainByReserveIds(reserveIds);
    }

    /**
     * 删除预订信息信息
     * 
     * @param reserveId 预订信息主键
     * @return 结果
     */
    @Override
    public int deleteReserveMainByReserveId(Long reserveId)
    {
        return reserveMainMapper.deleteReserveMainByReserveId(reserveId);
    }
}
